package com.zatech.cgnci.project.base.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Objects;

/**
 * 理赔任务类型
 */
@Getter
@AllArgsConstructor
public enum ClaimReinsurerTypeEnum {
    // 再保人类型(CEDING-分出人 ACCEPTOR-接受人)
    CEDING("CEDING", "再保分出人"),
    ACCEPTOR("ACCEPTOR", "再保接受人"),
    ;

    public static ClaimReinsurerTypeEnum getEnumByCode(String code) {
        return Arrays.stream(values()).filter(e -> Objects.equals(e.getCode(), code)).findAny().orElse(null);
    }

    private String code;
    private String name;
}
